package com.zgt.web;

import com.opensymphony.xwork2.ActionSupport;

public class AbstractAction extends ActionSupport {

	protected void checkEmpty(String filedName, String string) {
		if (filedName.isEmpty() || filedName == null) {
			addActionError(string);
		}
	}

	protected void checkEmail(String fieldName, String errorMessage) {
		boolean boo = fieldName
				.matches("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
		if (!boo) {
			addActionError(errorMessage);
		}
	}

}
